<div class="main-container" #wrap>
    <div class="main-content">
        <div class="content-top-bar">
            <div class="search-box" >
                <nz-form-item nzFlex class="mr-10">
                    <nz-form-label>年份</nz-form-label>
                    <nz-form-control>
                        <nz-year-picker
                                [(ngModel)]="year"
                                [nzDisabledDate]="disabledDate"
                                (ngModelChange)="getGridData()">
                        </nz-year-picker>
                    </nz-form-control>
                </nz-form-item>
                <nz-form-item nzFlex>
                    <button nz-button nzType="default" (click)="reset()">重置</button>
                </nz-form-item>
            </div>
            <div class="table-btn-group" *ngIf="sectionId === '168' || sectionId === '169'">
                <button nz-button nzType="primary" (click)="openDetailPage('add')">计划录入</button>
            </div>
        </div>
        <div class="table-content dark-blue-table">
            <nz-table #myTable
                      [nzData]="tableData"
                      nzBordered
                      nzSize="middle"
                      [nzLoading]="loading"
                      [nzTotal]="total"
                      [nzPageIndex]="pageNum"
                      [nzPageSize]="pageSize"
                      (nzPageIndexChange)="getGridData()">
                <thead>
                <tr>
                    <th style="width:150px">序号</th>
                    <th>计划名称</th>
                    <th style="width:180px">年份</th>
                    <th style="width:200px">操作</th>
                </tr>
                </thead>
                <tbody>
                <tr *ngFor="let data of tableData; let idx = index">
                    <td style="width:150px">{{ idx + 1}}</td>
                    <td>{{data.name}}</td>
                    <td style="width:180px">{{data.y}}</td>
                    <td style="width:200px">
                        <a (click)="openDetailPage('detail', data.name, data.section_id,data.y)">查看</a>
                        <nz-divider nzType="vertical" *ngIf="sectionId === '168' || sectionId === '169'"></nz-divider>
                        <a *ngIf="sectionId === '168' || sectionId === '169'" (click)="openDetailPage('edit', data.name, data.sectionId,data.y)">修改</a>
                    </td>
                </tr>
                </tbody>
            </nz-table>
        </div>
    </div>
</div>
